package com.mfin.bom.objects;

// Generated 17 Jun, 2012 11:27:33 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Finance generated by hbm2java
 */
@Entity
@Table(name = "finance", catalog = "mfindb")
public class Finance implements java.io.Serializable {

	private Long id;
	private Address address;
	private String financeName;
	private Set<LoanPreference> loanPreferences = new HashSet<LoanPreference>(0);
	private Set<Customer> customers = new HashSet<Customer>(0);
	private Set<DocCharge> docCharges = new HashSet<DocCharge>(0);
	private Set<BankInfo> bankInfos = new HashSet<BankInfo>(0);
	private Set<Cashbook> cashbooks = new HashSet<Cashbook>(0);
	private Set<FinanceLoan> financeLoans = new HashSet<FinanceLoan>(0);
	private Set<User> users = new HashSet<User>(0);
	private Set<Partner> partners = new HashSet<Partner>(0);

	public Finance() {
	}

	public Finance(Address address, String financeName,
			Set<LoanPreference> loanPreferences, Set<Customer> customers,
			Set<DocCharge> docCharges, Set<BankInfo> bankInfos,
			Set<Cashbook> cashbooks, Set<FinanceLoan> financeLoans,
			Set<User> users, Set<Partner> partners) {
		this.address = address;
		this.financeName = financeName;
		this.loanPreferences = loanPreferences;
		this.customers = customers;
		this.docCharges = docCharges;
		this.bankInfos = bankInfos;
		this.cashbooks = cashbooks;
		this.financeLoans = financeLoans;
		this.users = users;
		this.partners = partners;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ADDRESS_ID")
	public Address getAddress() {
		return this.address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	@Column(name = "FINANCE_NAME", length = 50)
	public String getFinanceName() {
		return this.financeName;
	}

	public void setFinanceName(String financeName) {
		this.financeName = financeName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "finance")
	public Set<LoanPreference> getLoanPreferences() {
		return this.loanPreferences;
	}

	public void setLoanPreferences(Set<LoanPreference> loanPreferences) {
		this.loanPreferences = loanPreferences;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "finance")
	public Set<Customer> getCustomers() {
		return this.customers;
	}

	public void setCustomers(Set<Customer> customers) {
		this.customers = customers;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "finance")
	public Set<DocCharge> getDocCharges() {
		return this.docCharges;
	}

	public void setDocCharges(Set<DocCharge> docCharges) {
		this.docCharges = docCharges;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "finance")
	public Set<BankInfo> getBankInfos() {
		return this.bankInfos;
	}

	public void setBankInfos(Set<BankInfo> bankInfos) {
		this.bankInfos = bankInfos;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "finance")
	public Set<Cashbook> getCashbooks() {
		return this.cashbooks;
	}

	public void setCashbooks(Set<Cashbook> cashbooks) {
		this.cashbooks = cashbooks;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "finance")
	public Set<FinanceLoan> getFinanceLoans() {
		return this.financeLoans;
	}

	public void setFinanceLoans(Set<FinanceLoan> financeLoans) {
		this.financeLoans = financeLoans;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "finance")
	public Set<User> getUsers() {
		return this.users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "finance")
	public Set<Partner> getPartners() {
		return this.partners;
	}

	public void setPartners(Set<Partner> partners) {
		this.partners = partners;
	}

}
